import http from "./request.ts"
// flashSession/list 获取全部场次
export const flashSessionList = (): RES<IFlashSessionListModel[]> => http.get("/flashSession/list")

// flashSession/create 添加场次
export const flashSessionCreate = (params: IFlashSessionCreateP): RES<IFlashSessionCreateR> => http.post("/flashSession/create", params)

// flashSession/update/status/{id} 修改启用状态
export const flashSessionUpdateStatus = (params: { id: number, status: number }): RES<IFlashSessionCreateR> => http.post(`/flashSession/update/status/${params.id}?status=${params.status}`)
// flashSession/delete/{id} 删除场次
export const flashSessionDeleteById = (id: number): RES<IFlashSessionCreateR> => http.post(`/flashSession/delete/${id}`)
// /flashSession/update/{id} 修改场次
export const flashSessionUpdateByID = (params: IFlashSessionListModel): RES<IFlashSessionCreateR> => http.post(`/flashSession/update/${params.id}`, params)
// flashSession/selectList 获取全部可选场次及其数量
export const flashSessionSelectList = (flashPromotionId: number): RES<IFlashSessionSelectListR[]> => http.get(`/flashSession/selectList?flashPromotionId=${flashPromotionId}`)